export const getTemplateFormConfig = (type, configData,form) => {
    switch (type) {
        case 'tag':
            return {
                formItems: [
                    { component: 'input', pattern: 'simple', name: 'tagType', label: '类型字段', span: 8, options: { } },
                    { component: 'input', pattern: 'simple', name: 'effect', label: '主题字段', span: 8, options: { } },
                    { component: 'input', pattern: 'simple', name: 'color', label: '颜色字段', span: 8,options: { } },
                ]
            }
            break;
        case 'spanLink':
            return {
                formItems: [
                    { component: 'select', name: 'target', label: '操作类型', span: 8, options: { items: [{label:'打开标签页',value:'tag'},{label:'打开对话框',value:'dialog'}]} },
                    { component: 'input', pattern: 'simple', name: 'paramTemplate', label: '模板', span: 8,options: { } },
                    { component: 'input', pattern: 'simple', name: 'url', label: '组件路径', span: 8,options: { } }
                ]
            }
            break;
        case 'rate':
            return {
                formItems: [
                    { component: 'input', pattern: 'simple', name: 'colors', label: '颜色', span: 12,options: {type:'textarea' } },
                    { component: 'input', pattern: 'simple', name: 'texts', label: '辅助文字', span: 12,options: { type:'textarea'} }
                ]
            }
            break;
        case 'icon':
            return {
                formItems: [
                    { component: 'input', pattern: 'simple', name: 'compoent', label: '图标字段', value:form.prop, span: 8, disabled:true,options:{}},
                ]
            }
            break;
        case 'image':
            return {
                formItems: [
                    { component: 'select', name: 'fit', label: '适应类型', span: 8, options: { items: [{ value: 'fill', label: 'fill' }, { value: 'contain', label: 'contain' }, { value: 'cover', label: 'cover' }, { value: 'none', label: 'none' },{ value: 'scale-down', label: 'scale-down' }] } },
                ]
            }
        break
        case 'button':
            return {
                formItems:[
                    { component: 'select', name: 'target', label: '操作类型', span: 6, options: { items: [{label:'打开标签页',value:'tag'},{label:'打开对话框',value:'dialog'},{label:'调取接口',value:'ajax'},{label:'更新数据',value:'update'}]} },
                    { component: 'select', name: 'btnType', label: '按钮样式', span: 6, options: { items: [{label:'primary',value:'primary'},{label:'success',value:'success'},{label:'info',value:'info'},{label:'warning',value:'warning'},{label:'danger',value:'danger'}]} },
                    { component: 'input', pattern: 'simple', name: 'url', label: '组件路径', span: 6,options: { } },
                    { component: 'checkboxGroup', name: 'showType', label: '显示按钮类型', span: 6, options: {items:[{value:'1',label:'编辑类型'},{value:'2',label:'保存取消类型'}],max:1} },
                    { component: 'switchv', name: 'fullscreen', label: '对话框是否全屏', span: 6, options: {} },
                    { component: 'input', pattern: 'simple', name: 'title', label: '标题', span: 6,options: { } },
                    { component: 'inputNumber', pattern: 'simple', name: 'width', label: '对话框宽度', span: 6,options: { } },
                    { component: 'input', pattern: 'simple', name: 'paramTemplate', label: '模板', span: 12,options: { } },
                    { component: 'input', pattern: 'simple', name: 'promptStatement', label: 'ajax提示语句', span: 12,options: { } },
                    
                ]
            }
    }
}
export const getEditItemFormConfig = (type, configData,form) => {
    switch (type) {
        case 'input':
            return {
                formItems: [
                    { component: 'input', pattern: 'simple', name: 'defaultValue', label: '默认值',  span: 8,options:{}},
                ]
            }
            break;
            case 'select':
                return {
                    formItems: [
                        { component: 'select', name: 'dataset', label: '数据集设置', span: 6, options: { items: configData.dbServiceList } },
                        { component: 'switchv', name: 'multiple', label: '是否多选', span: 6, options: {} },
                        { component: 'inputNumber', pattern: 'simple', name: 'limit', label: '最多选择', span: 6, options: { min: 0 } }
                    ]
                }
            break;
            case 'switchv':
                return {
                    formItems: [
                        { component: 'input', pattern: 'simple', name: 'activeValue', label: '选中值', span: 6, options: {} },
                        { component: 'input', pattern: 'simple', name: 'inactiveValue', label: '未选中值', span: 6, options: {} },
                    ]
                }
            break;
            case 'datePicker':
                return {
                    formItems: [
                        { component: 'select', name: 'dateType', label: '日期类型', span: 6, options: { items: [{ value: 'year', label: '年' }, { value: 'month', label: '月' }, { value: 'date', label: '日' }, { value: 'dates', label: '多个日期' }, { value: 'week', label: '周' }, { value: 'datetime', label: '日期时间' }, { value: 'datetimerange', label: '日期时间范围' }, { value: 'daterange', label: '日期范围' }, { value: 'monthrange', label: '月份范围' }] } },
                        { component: 'input', pattern: 'simple', name: 'valueFormat', label: '日期格式', span: 6, options: {} },
                    ]
                }
            break;
    }
}